/*$(function() {
	$('#FullScreen').click(function(){
		$('.header').toggleClass('fullscreen');
		$('.footer').toggleClass('fullscreen');
		$('#Wrapper').toggleClass('full-height');
		$('body').toggleClass('full-height');
		$('.content').toggleClass('full-height');
		$('#Topbar').toggleClass('top-0');
		if($('.header').hasClass('fullscreen')){
			var docElement, request;

		    docElement = document.documentElement;
		    request = docElement.requestFullScreen || docElement.webkitRequestFullScreen || docElement.mozRequestFullScreen || docElement.msRequestFullScreen;

		    if(typeof request!="undefined" && request){
		        request.call(docElement);
		    }
		}else{
			var docElement, request;

		    docElement = document;
		    request = docElement.cancelFullScreen|| docElement.webkitCancelFullScreen || docElement.mozCancelFullScreen || docElement.msCancelFullScreen || docElement.exitFullscreen;
		    if(typeof request!="undefined" && request){
		        request.call(docElement);
		    }
		}
	});	
//	$( ".toolTip" ).on().tipTip();
});*/

function inicializarVista(selector){
	var vista = localStorage['tipo_vista'] || 'file-detail';
	localStorage['show-icons-toolbar'] = 'false';
	if(vista == 'file'){
		localStorage['show-icons-toolbar'] = 'true';
	}
	$(".file-container #"+selector).attr("class", vista);
	
	$(".file-upload").bind('change', function() {
		maxSize=$(this).attr("data");
		actualSize = this.files[0].size;
		message = $("#fileUploadMsg").html();
		if(actualSize > maxSize){
			$(this).replaceWith($(this).val('').clone(true));
			Winter.ui.ShowErrorMessage('#Error', message);
		}
	});
	
//	$("#ContextMenuOutput").prepend($(".context-menu-list"));
}

function cambiarVista(selector){
	$("#VistaIconos").click(function(){
		localStorage['tipo_vista'] = 'file';
		localStorage['show-icons-toolbar'] = 'true';
		$(".file-container #"+selector).removeClass("file-detail").addClass("file");
		$(".file-container #"+selector+ ".Heading").addClass("hidden");
		$(".file-container #"+selector+ ".vista-detalle").addClass("hidden");
		$(".file-container #"+selector+ ".fila").removeClass("Row");
		$(".file-container #"+selector+ ".columna").removeClass("Cell");
		$(".file-container #"+selector+ ".file-info").removeClass("Cell");
	});
	$("#VistaDetalle").click(function(){
		localStorage['tipo_vista'] = 'file-detail';
		localStorage['show-icons-toolbar'] = 'false';
		$(".file-container #"+selector).removeClass("file").addClass("file-detail");
		$(".file-container #"+selector+ ".vista-iconos").addClass("hidden");
		$(".file-container #"+selector+ ".Heading").removeClass("hidden");
		$(".file-container #"+selector+ ".fila").addClass("Row");
		$(".file-container #"+selector+ ".columna").addClass("Cell");
		$(".file-container #"+selector+ ".file-info").addClass("Cell");
	});	
}

$(function() {
	$('.winter-tabbed-menu-item').click(function(){
		if($('#Menu').hasClass('open-menu')){
			$("#Menu").removeClass("open-menu").addClass("close-menu");
		}else{
			$("#Menu").removeClass("close-menu").addClass("open-menu");
		}
	});
});


function checkform(pswd){
	// set password variable
	//var pswd = $(this).val();
	var pswdlength = false; var pswdletter = false; var pswduppercase = false; var pswdnumber = false; 
	
	
	//validate the length
	if ( pswd.length >= 8 ) {
		$('#length').removeClass('invalid').addClass('valid'); pswdlength=true;
	} else {
		$('#length').removeClass('valid').addClass('invalid');  
	}
	
	//validate letter
	if ( pswd.match(/[A-z]/) ) {
		$('#letter').removeClass('invalid').addClass('valid'); pswdletter=true;
	} else {
		$('#letter').removeClass('valid').addClass('invalid');  
	}
	
	//validate uppercase letter
	if ( pswd.match(/[A-Z]/) ) {
		$('#capital').removeClass('invalid').addClass('valid'); pswduppercase=true;
	} else {
		$('#capital').removeClass('valid').addClass('invalid'); 
	}
	
	//validate number
	if ( pswd.match(/\d/) ) {
		$('#number').removeClass('invalid').addClass('valid'); pswdnumber=true;
	} else {
		$('#number').removeClass('valid').addClass('invalid');
	}
	
	if( pswdlength && pswdletter && pswduppercase && pswdnumber){ 
		$('#pswd_info').show();
		return true;
	}else{
		$('#pswd_info').show();
		return false;
	}
}